package Demo01;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
    }

    public static void main03(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x1 = scanner.nextInt();
        int y1 = scanner.nextInt();
        int x2 = scanner.nextInt();
        int y2 = scanner.nextInt();
        int x3 = scanner.nextInt();
        int y3 = scanner.nextInt();
        int x4 = scanner.nextInt();
        int y4 = scanner.nextInt();
        if(x1<=x3&&x2>=x4&&y1<=y3&&y2>=y4) {
            System.out.println((x2-x1)*(y2-y1));
        }else if(x1>=x3&&x2<=x4&&y1>=y3&&y2<=y4) {
            System.out.println((x4-x3)*(y4-y3));
        } else if(x2<=x3||x4<=x1||y2<=y3||y4<=y1) {
            System.out.println(0);
        } else {
/*            int midX = -1;
            if(x3>x1&&x3<x2) {
                midX = x3;
            }else {
                midX = x4;
            }
            int midY = -1;
            if(y3>y1&&y3<y2) {
                midY = y3;
            }*/
            if(x1<x3&&x3<x2&&y4<y2&&y4>y1) {
                System.out.println((x2-x1)*(y2-y1)+(x4-x3)*(y4-y3)-(x2-x3)*(y4-y1));
            }
            if(x3<x2&&x3>x1&&y3<y2&&y3>y1) {
                System.out.println((x2-x1)*(y2-y1)+(x4-x3)*(y4-y3)-(x2-x3)*(y2-y3));
            }
            if(x4<x3&&x4<x2&&y4<y2&&y4>y1) {
                System.out.println((x2-x1)*(y2-y1)+(x4-x3)*(y4-y3)-(x4-x1)*(y4-y1));
            }
            if(x4<x2&&x4>x1&&y3<y2&&y3>y1) {
                System.out.println((x2-x1)*(y2-y1)+(x4-x3)*(y4-y3)-(x4-x1)*(y2-y3));
            }
        }

    }
    /**
     * @param num 数字
     * @param a   进制转换
     * @return 进制转换的和
     */
    public static int change(int num, int a) {
        int sum = 0;
        while (num > 0) {
            sum += num % a;
            num /= a;
        }
        return sum;
    }

    public static void main01(String[] args) {
/*        int count = 0;
        for (int i = 1; i <= 300000; i++) {
            int a2 = change(i, 2);
            int a8 = change(i, 8);//14
            int a10 = change(i, 10);
            int a16 = change(i, 16);
            if(((i%a2)!=0)||((i%a8)!=0)||((i%a10)!=0)||((i%a16)!=0)) {
                continue;
            }
            System.out.println(i);
            count++;
            if(count==2023) {
                break;
            }
        }
        System.out.println();
        System.out.println(count);*/
        System.out.println(215040);
    }
}

